// Copyright (c) 2021 Presto Labs Pte. Ltd.
// Author: fengyang

#include "coin2/exchange/deribit_futures/symbology/currency.h"

#include <gtest/gtest.h>

TEST(DeribitFuturesCurrency, constructor) {
  using namespace coin2::exchange::deribit_futures::symbology;
  using coin2::exchange::base::market::ExchangeType;
  using coin2::exchange::base::market::MarketType;

  int64_t resolve_ts = 1572502253 * 1e9;

  auto btc1 = DeribitFuturesCurrency::FromNativeStr("BTC", resolve_ts);
  EXPECT_EQ(btc1.currency(), "BTC");
  EXPECT_EQ(btc1.native_currency(MarketType::Futures), "BTC");
  EXPECT_EQ(btc1.exchange(), ExchangeType::Deribit);

  auto btc2 = DeribitFuturesCurrency::FromNormStr("BTC", resolve_ts);
  auto btc3 = DeribitFuturesCurrency::FromStr("BTC", resolve_ts);
  EXPECT_EQ(btc2, btc1);
  EXPECT_EQ(btc3, btc1);

  auto usd1 = DeribitFuturesCurrency::FromNativeStr("USD", resolve_ts);
  EXPECT_EQ(usd1.currency(), "USD");
  EXPECT_EQ(usd1.native_currency(MarketType::Futures), "USD");
  EXPECT_EQ(usd1.exchange(), ExchangeType::Deribit);
}
